package com.taint.asm.service;

import com.taint.asm.model.ClassReference;
import com.taint.asm.model.InheritanceMap;
import com.taint.asm.model.MethodReference;

import java.util.List;
import java.util.Map;
/*
https://github.com/jimocode/
CodeInspector/blob/master/src/main/java/org/sec/Main.java
 */
public class Inheritance {

    public static InheritanceMap anyalzer(List<ClassReference> discoveredClasses, List<MethodReference> discoveredMethods, Map<ClassReference.Handle, ClassReference> classMap, Map<MethodReference.Handle, MethodReference> methodMap){


        for (ClassReference clazz : discoveredClasses) {
            classMap.put(clazz.getHandle(), clazz);
        }
        for (MethodReference method : discoveredMethods) {
            methodMap.put(method.getHandle(), method);
        }

        return InheritanceUtil.derive(classMap);


    }



}
